<div class="header">
	<ol class="breadcrumb">
		<li>
			<a href="#"><i class="fa fa-home"></i>首页</a>
		</li>
		<li>
			<a href="#">统计报表</a>
		</li>
		<li class="active" id="banner">统计报告</li>
	</ol>
</div>
<div class="row">
	<div id="getId" class="col-lg-2 col-xs-2 col-md-2" style="height: 800px;   ">
		<div class="tabT">
			<!--<span style="height: 30px;line-height: 30px;padding-left: 10px ">统计报表</span>-->
			<ul class="tab" id="tab">
				<li id="tabId0" class="current" onclick="tab('tabId0','Page/statictable/totalView.html','统计报告');">&nbsp;<i class="fa fa-map-marker"></i>&nbsp;&nbsp;统计报告</li>
			</ul>
		</div>

	</div>
	<div class="col-lg-10 col-xs-10 col-md-10">
		<div class="show" id="tabC">统计规则
		</div>
	</div>
</div>
<script type="text/javascript" language="javascript">
	$(function() {
		setMenu();
		GLOBAL.MODULEURL = 'Page/statictable/index.html';
		$("#tabC").load("Page/statictable/totalView.html",function(){
			setTable();
		});
	});

	function tab(tabId, url, info, id) {
		$("#banner").html(info);
		var len = document.getElementById('getId').getElementsByTagName('li').length;
		for(i = 0; i < len; i++) {
			$("#tabC").removeClass("rulestatic_load");
			if("tabId" + i == tabId) {
				document.getElementById(tabId).className = "current";
				$("#tabC").load(url, function() {
					setTable(id);
					$("#id").val(id);
				});
			} else {
				document.getElementById("tabId" + i).className = "";
			}
		}
	}
	//处理菜单
	function setMenu() {
		var liststr = "";
		//加载统计
		var json = {
			url: GLOBAL.URL + "/chartinfo/list",
			type: 'get',
			data:{"chartType":"table"},
			successfn: function(data) {
				if(data != null) {
					for(var i = 0; i < data.page.list.length; i++) {
//						if(i == 0) {
//							var id = data.page.list[i].id
//							$("#tabC").load("Page/statictable/view.html", function() {
//								setTable(id);
//								$("#id").val(id);
//							});
//						}
//						if(i == 0) {
//							liststr += '<li id="tabId' + (1 + i) + '" class = "current" onclick=tab("tabId' + (1 + i) + '","Page/statictable/view.html","' + data.page.list[i].title + '",' + data.page.list[i].id + ');><i class="fa fa-bar-chart-o "></i>&nbsp;&nbsp;' + data.page.list[i].title + '</li>';
//						} else {
							liststr += '<li id="tabId' + (1 + i) + '" onclick=tab("tabId' + (1 + i) + '","Page/statictable/view.html","' + data.page.list[i].title + '",' + data.page.list[i].id + ');><i class="fa fa-bar-chart-o "></i>&nbsp;&nbsp;' + data.page.list[i].title + '</li>';
						//}
					}
				}
			},
			errorfn: function() {}
		};
		ajaxdata(json);
		$("#tab").append(liststr);
	}
</script>